<template>
  <div class="app-container customer-div">
    <el-menu :default-active="tab" class="el-menu-demo" mode="horizontal" @select="handleSelect">
      <el-menu-item index="priceService">价格维护</el-menu-item>
      <el-menu-item index="quotationsView">行情查看</el-menu-item>
    </el-menu>

    <!--数据列表-->
    <div class="table-container">
      <!--价格维护-->
      <priceService ref="priceService" v-show="tab=='priceService'"></priceService>
      <!-- 行情查看 -->
    </div>
  </div>
</template>
<script>
import store from '@/store'
import priceService from './components/priceService'
import { mapGetters } from 'vuex'

export default {
  name: "myCustomForFollow",
  data(){
    return {
      roles:store.getters.roles ? store.getters.roles : [],
      tab:'priceService',
    }
  },
  computed: {
    ...mapGetters([
      'name',
      'mobile',
      'userId'
    ]),
    // departmentCustomTab(){
    //   if(this.roles.indexOf("departmentCustomTab") != -1){
    //     return true
    //   }else{
    //     return false
    //   }
    // },
  },
  components : {
    priceService
  },
  mounted() {
    this.$nextTick(() => {
      // dom元素更新后执行，因此这里能正确打印更改之后的值
      this.$refs.priceService.getList();
    })
  },

  filters: {


  },

  methods:{
    /**
     * 切换选择状态
     */
    handleSelect(key, keyPath){
      this.tab = key;
      if(key == 'priceService'){
        this.$nextTick(() => {
          this.$refs.priceService.getList();
        })
      }else if(key == 'quotationsView'){
        this.$nextTick(() => {
          window.open(`http://www.moresu.com/price`, '_blank');
        })
      }
    },


  },
}
</script>

<style lang="scss">


</style>
